<?php

namespace app\admin\controller;

use think\Controller;
use think\Request;

use app\admin\model\Admin;
use app\admin\model\Role;
use app\admin\model\AdminRole;
use app\admin\model\LoginLog as LoginLogModel;

class LoginLog extends BaseController
{
    /**
     * 显示资源列表
     *
     * @return \think\Response
     */
    public function index()
    {
        $list = LoginLogModel::order('id','desc')->paginate(20);
        $adminName = Admin::where('status',1)->column('username','id');
        $roleName = Role::column('name','id');
        $adminRoleId = AdminRole::column('role_id','admin_id');
        $this->assign('list',$list);
        $this->assign('admin_name',$adminName);
        $this->assign('role_name',$roleName);
        $this->assign('admin_role_id',$adminRoleId);
        return $this->fetch();
    }
}
